<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			
			
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		mounted() {
			setTimeout(() => {
				this.global()
			}, 0)
		},
		methods: {
			global() {
				// 获取系统信息
				const systemInfo = uni.getSystemInfoSync();
				console.log(systemInfo)
				// statusBarHeight（手机顶部信息栏高度）
				const statusBarHeight = systemInfo.statusBarHeight
				uni.setStorageSync('statusBarHeight', statusBarHeight)
				// screenTop （小程序顶部高度）注：screenTop真机调试不生效，只能曲线救国（systemInfo.screenHeight - systemInfo.windowHeight）
				const screenTop = systemInfo.screenHeight - systemInfo.windowHeight
				uni.setStorageSync('screenTop', screenTop)
				// 小程序头部高度
				const navBarHeight = systemInfo.statusBarHeight + systemInfo.screenTop;
				// 存储头部高度
				uni.setStorageSync('navBarHeight', navBarHeight)
			}
		}
	}
</script>

<style lang="scss">
	@import "@/uni_modules/uview-ui/index.scss";
</style>
